package cn.shiwei.basic.util;

import lombok.Data;

@Data
public class RequestStatus {

    private Boolean success = true;
    private String message = "操作成功";

    /**
     * 携带的参数
     */
    private Object resultObj;

    public static RequestStatus me(){
        return new RequestStatus();
    }

    public RequestStatus setMessage(String message) {
        this.success = false;
        this.message = message;
        return this;
    }

    public RequestStatus setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

    @Override
    public String toString() {
        return "{" +
                "\"success\":" + success +
                ", \"message\":" + "\"" + message + "\"" +
                ", \"resultObj\":"+ resultObj +
                '}';
    }
}
